package com.dlut.java;


import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class DiDi {
    /**
     * 美丽数
     */
/*    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        int[] l = new int[T];
        int[] r = new int[T];
        int[] t = new int[T];
        for (int i = 0; i < T; i++) {
            l[i] = in.nextInt();
        }
        for (int i = 0; i < T; i++) {
            r[i] = in.nextInt();
        }
        for (int i = 0; i < T; i++) {
            t[i] = in.nextInt();
        }

        HashMap<Integer, Integer> map = new HashMap<>(80000);
        int[] temp = new int[5];
        for (int i = 0; i < T; i++) {
            int count = 0;
            for (int j = l[i]; j <= r[i]; j++) {
                int bet=0;
                if (map.containsKey(j)){
                    bet = map.get(j);
                }else {
                    temp[0] = j / 10000;
                    temp[1] = (j - temp[0] * 10000 )/1000;
                    temp[2] = (j - temp[0] * 10000 -temp[1] * 1000)/100;
                    temp[3] = (j - temp[0] * 10000 -temp[1] * 1000 - temp[2] * 100)/10;
                    temp[4] = j % 10;
                    bet = 0;
                    for (int k = 0; k < 5; k++) {
                        bet = bet ^ temp[k];
                    }
                    map.put(j,bet);
                }
                if (bet == t[i])
                    count++;
            }
            if (i != T-1)
                System.out.print(count + " ");
            else
                System.out.println(count);
        }
    }*/


    /**
     * 装桃子
     * @param args
     */
   public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        long[] b = new long[n+1];
        b[0] = 0;
        Arrays.sort(a);
        for (int i = 1; i <= n; i++) {
            b[i] = b[i-1] + a[i-1];
        }

        int maxLen = 1;
        int left = 0, right = 0;
        while (right < n && left <= right){
            while (right<n && isT(a,b,left,right,k)){
                right++;
            }
            maxLen = Math.max(maxLen, right - left);
            left++;
        }
        left = n - 1;
        right = n-1;
       while (left >= 0 && left <= right){
           while (left >= 0 && isT(a,b,left,right,k)){
               left--;
           }
           maxLen = Math.max(maxLen, right - left);
           right--;
       }
       for (int i = 0; i < n; i++) {
           for (int j = 0; j < n; j++) {
               if (i<=j &&isT(a,b,i,j,k)){
                   maxLen = Math.max(maxLen, j - i+1);
               }
           }
       }
        System.out.println(maxLen);
    }
    static boolean isT(int[] a, long[] b, int l, int r, int k){
        long sum = b[r+1] - b[l];
        int max = a[r];
        return sum * k > ((long) max  * (r - l + 1));
    }

}
